<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>数据上报任务详情</title>
<#include "/common/resource.ftl">
<style>
.info-table{width:100%;}
.info-table .info-lable{text-align: right;white-space: nowrap;font-weight: normal;width: 90px;padding:10px;padding-right: 10px;background: #fafafa;border-right: 1px solid #eee;border-bottom: 1px solid #eee;}
.info-table .info-value{width: auto;padding: 10px;border-bottom: 1px solid #eee;}
</style>
<script type="text/javascript" src="${params.contextPath}/js/moment.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	<#if params.id??>
	$.ajax({
        type: "GET",
        url: "${params.contextPath}/web/taskCycle/query.json?id=${params.id}",
        dataType: "json",
        success: function(resp){
        	data = resp.data;
        	for(var key in data){
        		
        		if(key == "type"){
        			//alert(data[key])
        			switch (data[key]) {
					case 0: 
						$("#"+key).html("一次性"); 
						$("#intervalDateContent").hide();
						//$("#runLineContent").hide();
						$("#deadLineContent").hide();
						break;
					case 1: 
						$("#"+key).html("每日");
						$("#intervalDateContent").hide();
						//$("#runLine").html("每日"+data["runLine"]+"时");
						break;
					case 2: 
						$("#"+key).html("每周");
						var weeks=['一','二','三','四','五','六','日'];
						$("#intervalDate").html("每周"+weeks[data["intervalDate"]-1]);
						//$("#runLine").html(data["runLine"]+"时");
						break;
					case 3: 
						$("#"+key).html("每月");
						$("#intervalDate").html("每月"+data["intervalDate"]+"号");
						//$("#runLine").html(data["runLine"]+"时");
						break;
					default: break; }
        		}else if(key == "priority"){
        			switch (data[key]) {
					case 1:
						$("#"+key).html("普通"); break;
					case 2:
						$("#"+key).html("紧急"); break;
					case 3:
						$("#"+key).html("非常紧急"); break;
					default:
						break;
					}
        		}else if(key == "intervalDate"){
        			
        		}else if(key == "runLine"){
        			
        		}else if(key == "deadLine"){
        			$("#"+key).html(moment(new Date(data[key])).format("YYYY-MM-DD"));
        		}else if(key == "createTime"){
        			$("#"+key).html(moment(new Date(data[key])).format("YYYY-MM-DD HH:mm:ss"));
        		}else{
        			$("#"+key).html(data[key]);
        		}
        		
        		
        		
        	}
        }
    });
	</#if>
});	
</script>
</head>
<body>
	<table class="info-table">
		<tr>
			<td class="info-lable">数据上报模板</td>
			<td class="info-value" id="templateName"></td>
		</tr>
		<tr>
			<td class="info-lable">优先级</td>
			<td class="info-value" id="priority"></td>
		</tr>
		<tr>
			<td class="info-lable">数据上报周期</td>
			<td class="info-value" id="type"></td>
		</tr>
		
		<tr id="intervalDateContent">
			<td class="info-lable">数据上报日期</td>
			<td class="info-value" id="intervalDate"></td>
		</tr>
		<!-- <tr id="runLineContent">
			<td class="info-lable">发布任务时间</td>
			<td class="info-value" id="runLine"></td>
		</tr> -->
		<tr id="deadLineContent">
			<td class="info-lable">计划截止日期</td>
			<td class="info-value" id="deadLine"></td>
		</tr>
		<tr>
			<td class="info-lable">要求完成时限</td>
			<td class="info-value" id="complateTimeCount"></td>
		</tr>
		<tr>
			<td class="info-lable">执行单位</td>
			<td class="info-value" id="actorNames"></td>
		</tr>
		<tr>
			<td class="info-lable">说明</td>
			<td class="info-value" id="remark"></td>
		</tr>
		
		<tr>
			<td class="info-lable">编制人</td>
			<td class="info-value" id="createName"></td>
		</tr>
		
		<tr>
			<td class="info-lable">编制单位</td>
			<td class="info-value" id="orgName"></td>
		</tr>
		<tr>
			<td class="info-lable">编制时间</td>
			<td class="info-value" id="createTime"></td>
		</tr>
		
	</table>


</body>
</html>
